import http from "../../utils/requestAI";
import type { FoodsData, FoodsList, FoodsParams, SuppliersData } from "./type";
/**
 * 获取食材列表
 */
export const getFoods = (params?: FoodsParams) => http.get<FoodsData>("/foods/list", params);

/**
 * 删除食材
 */
export const delFood = (id:number) => http.delete(`/foods/delete/${id}`);

/**
 * 批量删除食材
 */
export const delFoods = (ids:number[]) => http.post(`/foods/deleteAll/`,ids);


/**
 * 添加食材
 */
export const addFood = (data:FoodsList) => http.post("/foods/add", data);


// 更具id获取食材信息
export const getFood = (id:number) => http.get<FoodsList>(`/foods/get/${id}`);

/**
 * 修改食材信息
 */
export const updateFood = (data:FoodsList) => http.put("/foods/update", data);


/**
 * 供应商列表
 */
export const getSuppliers = (params?: FoodsParams) => http.get<SuppliersData>("/supplier/list",params);

